package com.cpkso.yzx.domain;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 内容
 * @author wrzhxy@qq.com
 * @date 2017年11月9日
 */
@Entity
@Table(name="t_news")
public class News {
	@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	private String title;
	private String pic;
	private String brief;
	@ManyToOne
	@JoinColumn(name="col")
	private Col col;
	@Lob
	@Basic(fetch=FetchType.LAZY)
	private String detail;
	private String url;
	
	
	public News() {
	}
	/**
	 * no id
	 * @param title
	 * @param pic
	 * @param brief
	 * @param col
	 * @param detail
	 */
	public News(String title, String pic, String brief, Col col, String detail, String url) {
		this.title = title;
		this.pic = pic;
		this.brief = brief;
		this.col = col;
		this.detail = detail;
		this.url = url;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = "".equals(title) ? null : title;
	}
	public String getPic() {
		return pic;
	}
	public void setPic(String pic) {
		this.pic = "".equals(pic) ? null : pic;
	}
	public String getBrief() {
		return brief;
	}
	public void setBrief(String brief) {
		this.brief = "".equals(brief) ? null : brief;
	}
	public String getDetail() {
		return detail;
	}
	public void setDetail(String detail) {
		this.detail = "".equals(detail) ? null : detail;
	}
	public Col getCol() {
		return col;
	}
	public void setCol(Col col) {
		this.col = col;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
}
